package org.gruposp2p.dnie.model.xmladapter;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import org.gruposp2p.dnie.model.DNIeSignedDocument;

/**
 *
 * @author jj
 */
public class DNIeSignedDocumentAdapter extends XmlAdapter<Integer, DNIeSignedDocument> {

    @Override
    public Integer marshal(DNIeSignedDocument signedDocument) throws Exception {
        return signedDocument.getId();
    }

    @Override
    public DNIeSignedDocument unmarshal(Integer signedDocumentId) throws Exception {
        DNIeSignedDocument documentToSign = new DNIeSignedDocument();
        documentToSign.setId(signedDocumentId);
        return documentToSign;
    }

}
